<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>6.instanceof</title>
</head>
<body>
  <!-- instanceof类型判断 -->
  xialuo instanceof Student // true
  xialuo instanceof People // true
  xialuo instanceof Object // true

  [] instanceof Array // true
  [] instanceof Object // true

  {} instanceof Object // true

  总结：instanceof 判断是原型链上是否存在构造类
  xialuo instanceof Array // false 因为xialu的原型链上不存在Array

  <!-- 如何判断一个变量是不是数组 结合原型链本质去判断 -->
  a instanceof Array

  <script>
    let arr = []

    console.log({} instanceof Array);

  </script>


  
</body>
</html>